<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #drawForm="ngForm" novalidate autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>Bop引用</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row align-items-center m--margin-bottom-10">
                        <div class="col-xl-12">
                            <div class="form-group m-form__group align-items-center">
                                <div class="p-formgroup-inline" style="display: flex;">
                                    <div style="margin-right: 30px;display: flex;">
                                        <span style="width: 50px;line-height: 30px;">型号：</span>
                                        <p-dropdown filter="true" name="model" #lotNoSelect="ngModel" [options]="modelList"
                                            [(ngModel)]="model" dataKey="value" [optionLabel]="'label'"
                                            placeholder="请选择" (onChange)="onChange($event)">
                                        </p-dropdown>
                                    </div>
                                    <div style="margin-right: 10px;display: flex;">
                                        <span style="width: 50px;line-height: 30px;">发次：</span>
                                        <p-dropdown filter="true" name="lotNoList" #lotNoSelect="ngModel" [options]="lotNoList"
                                            [(ngModel)]="lotNo" dataKey="value" [optionLabel]="'label'"
                                            placeholder="请选择">
                                        </p-dropdown>
                                    </div>
                                    <div style="margin-right: 30px;display: flex;">
                                        <span style="width: 50px;line-height: 30px;">图号：</span>
                                        <input type="text" style="width: 150px;" name="drawiingNo" size="30" pInputText
                                            [(ngModel)]="drawingNo" class="form-control" />
                                    </div>
                                    <span class="input-group-btn">
                                        <p-button (onClick)="getProcessDraw()" label="查询"></p-button>
                                        <p-button label="重置" (onClick)="resetSearch()" style="margin-left: 10px;">
                                        </p-button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable (onLazyLoad)="getProcessDraw($event)" [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false"
                            [(selection)]="selectedCar" [lazy]="true" dataKey="id" [scrollable]="true"
                            ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 100px">
                                        选择
                                    </th>
                                    <th style="width: 150px">
                                        型号
                                    </th>
                                    <th style="width: 150px">
                                        发次
                                    </th>
                                    <th style="width: 150px">
                                        子版本
                                    </th>
                                    <th style="width: 150px">
                                        名称
                                    </th>
                                    <th style="width: 150px">
                                        图号
                                    </th>
                                    <th style="width: 150px">
                                        阶段标记
                                    </th>
                                    <!-- <th style="width: 150px">
                                        创建人
                                    </th> -->
                                    <th style="width: 150px">
                                        创建时间
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td style="width: 100px">
                                        <p-tableRadioButton [value]="record"></p-tableRadioButton>
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.model}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.lotNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.edition}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.modelName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.drawingNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.stageSign}}
                                    </td>
                                    <!-- <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.userName}}
                                    </td> -->
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.creationTime | momentFormat:'YYYY-MM-DD HH:mm:ss'}}
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <!-- <div class="primeng-paging-container">
                       <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage"
                                    #paginator
                                    (onPageChange)="getProcessDraw($event)"
                                    [totalRecords]="primengTableHelper.totalRecordsCount"
                                    [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                       </p-paginator>
                       <span class="total-records-count">
                           {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                       </span>
                   </div> -->
                    </div>
                </div>
                <div class="modal-footer" style="justify-content: center;">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">取消</button>
                    <button (click)="save()" type="button" class="btn btn-primary" [disabled]="!drawForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>引入</span></button>
                </div>
            </form>
        </div>
    </div>
</div>